<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class mtransaksi_jual extends base_model {

    public function __construct($tbl_name = null) {
        parent::__construct('');
    }

    function get_chart_tahun($tahun) {
        $this->db->where('tahun', $tahun);
        return $this->db->get('web_all_jual_tahun');
    }

    function get_chart_per_hari_by_retail($bulan, $tahun, $koderetail) {
        $this->db->where('koderetail', $koderetail);
        $this->db->where('thbl', $tahun . $bulan);
        return $this->db->get('web_all_jual_thbl');
    }

    function get_chart_per_tanggal($bulan, $tahun) {
        $this->db->where('thbl', $tahun . $bulan);
        return $this->db->get('web_all_jual_thbl');
    }

    function get_chart_per_bulan($bulan, $tahun) {
        $this->db->where('thbl', $tahun . $bulan);
        return $this->db->get('web_all_jual_tahun');
    }

    function get_chart_barang_per_bulan_by_retail($koderetail) {
        $this->db->where('koderetail', $koderetail);
        return $this->db->get('web_trx_barang_bln');
    }

    function get_chart_barang_json($koderetail) {
        return $this->db->query("select namabarang as name, total as data from web_trx_barang_bln where koderetail = ? ", $koderetail);
    }

}

/* End of file transaksi_jual.php */
/* Location: ./application/controllers/transaksi_jual.php */